<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Gregwar\Captcha\CaptchaBuilder;
use App\Http\Requests\UserinserttttRequest;

class AddressController extends Controller
{ 
   //结算页 地址添加
    public function postInsert(Request $request)
    { 

      $data = $request->except('_token');
       // dd($data);
     
      // dd(session('uid'));
      $data['uid'] = session('uid');
      // dd($data['uid']);
      $res= DB::table('address')->where('uid',$data['uid'])->insert($data);
      // dd($res);
      echo 0;
    }

    //结算页 地址删除
    public function postDelete(Request $request)
    {
        $id = $request->input('id');
        $res = DB::table('address')->where('id',$id)->delete();
        if($res){
          echo 1;
        }

    }




} 
